<!DOCTYPE html>
<html>
	<head>
		<title>设置个人资料</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
		<script src="/js/jquery/jquery.min.js"></script>
		<script src="/js/bootstrap/js/bootstrap.min.js"></script>
		<script src="/js/plugins/jquery-form/jquery.form.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
		<script src="/js/plugins/jrender/jrender.min.js"></script>
		<script src="/js/plugins/messager/jquery.bootstrap.min.js"></script>

		<link rel="stylesheet" href="/css/reset.css" />
		<link rel="stylesheet" href="/css/myInfo.css" />
		<script>
            $(function () {
                //取出共享的数据
                var user = JSON.parse(sessionStorage.getItem("stranger"));
                //将数据设置到数据中
                $('.info').renderValues(user);
                //添加背景样式,就是在css样式中中增加属性
				$('.myBg').css("background","url("+user.coverImgUrl+")")
				var flag; //定义一个临时变量用来区分点上传头像还是上传背景
				//修改头像
				$("#headBtn").click(function () {
				    //如果没有参数,默认就是直接弹出文件选择框
					//如果有参数就是绑定点击事件
					$('#imageFileBtn').click();
					flag = 1; // 上传头像
                });
				$("#coverBtn").click(function () {
				    //如果没有参数,执行点击事件
					$('#imageFileBtn').click();
					flag = 2; // 上传背景
                });

            })
		</script>
	</head>

	<body>

		<div class="search-head">
			<div class="row nav-search">
				<div class="col">
					<a href="javascript:window.history.go(-1);">
						<span>取消</span>
					</a>
				</div>
				<div class="col">
					<span>个人资料</span>
				</div>
				<div class="col">
					<span></span>
				</div>
			</div>
		</div>
		<!--修改头像的表单-->
		<div class="container info">
			<div class="myBg">
				<img id="headImg" render-src="headImgUrl"  class="rounded-circle"/>
				<div class="editHead" id="headBtn" ></div>
			</div>
			<!--编辑操作-->
				<label>昵称</label><span render-html="nickName" class="form-control"></span>
				<label>性别</label><select class="form-control" name="gender" render-value="gender" disabled>
						<option value="-1">保密</option>
						<option value="0">男</option>
						<option value="1">女</option>
					</select>
				<label>地区</label><span render-html="place" class="form-control"></span>
				<label>签名</label><textarea name="sign" class="form-control" render-value="sign" rows="5" readonly></textarea>
		</div>

	</body>
</html>
